home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Snippets / IconShow / IconShow++ ƒ / SITable.h < prev   
Encoding:
C/C++ Source or Header  |  1994-03-14  |  1.4 KB  |  43 lines  |  [TEXT/KAHL]

  1. /* 
  2.     Copyright © General Consulting & Research Inc. 1993-1994 All rights reserved.
  3.       Author:     Peter H. Teeson 
  4.     CIS:        72647,3674
  5.     AppleLink:    CDA0197
  6.       Date:        1 June 1993 
  7.     Path:IconShow++ ƒ:SITable.h
  8.        
  9.        This is the C++ Class declaration for the ShowINIT table.    
  10.  
  11.  */
  12. #pragma once 
  13. /* Constants & Enumerations */
  14. enum     SIitem{ vcheck, vloc, hloc, hcheck };        // indices of ShowInit table
  15. const     short    XOffset=40, YOffset=40;                // Icon bucket size
  16. const     short    IconWidth=32, InitialX=8;            // Icon width & initial location
  17.  
  18. /* Declarations */
  19. //extern    unsigned short screenWidth,screenDepth;
  20. class SITable {            // for our one and only ShowInit Table object    
  21. public:
  22.     SITable();                                        // constructor
  23.     ~SITable();                                        // destructor    
  24.      unsigned short& operator=(unsigned short& x);    // assignment operator
  25.     unsigned short& operator[](int index);            // subscripting operator
  26.     
  27.      unsigned short CheckSum(unsigned short x);        // computes checksum
  28.      void CheckRHEdge(SITable& x);                    // check if will be off RH edge
  29.      void NextLoc(SITable& x);                        // compute location of next icon    
  30. private:
  31.     unsigned short *sTable;
  32.     int    sz;                                            // for range checking
  33.     void Reset();                                    // reset table
  34.  
  35. };
  36.  
  37. /* Inlines */        
  38. #pragma parameter __D0 CheckSum( __D0 )
  39. unsigned short SITable::CheckSum( unsigned short x )={
  40.     0xE358,     // ROL.W    #1,D0
  41.     0x0A40,     // EORI.W    #$1021,D0
  42.     0x1021
  43. };